using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NetworkPower.DataModel.Models.Mapping
{
    public class UnitMap : EntityTypeConfiguration<Unit>
    {
        public UnitMap()
        {
            // Primary Key
            this.HasKey(t => t.UnitID);

            // Properties
            //this.Property(t => t.UnitValues)
            //    .IsRequired()
            //    .HasMaxLength(250);

            //this.Property(t => t.SeperatorNameValues)
            //    .IsRequired()
            //    .HasMaxLength(250);

            // Table & Column Mappings
            this.ToTable("Units");
            this.Property(t => t.UnitID).HasColumnName("UnitID");
            this.Property(t => t.SeperatorTypeID).HasColumnName("SeperatorTypeID");
            this.Property(t => t.UnitName).HasColumnName("UnitName");
            this.Property(t => t.SepertorName).HasColumnName("SepertorName");
        }
    }
}
